import request from '@/utils/request'

/**
 * 获取月卡列表
 * @param { page, pageSize} params
 * @returns
 */
export const getCardListAPI = (data) => {
  return request.get('/parking/card/list', data)
}
/**
     * 新增月卡
     * @data
     * @returns
     */
export const createCardAPI = (data) => {
  return request.post('/parking/card', data)
}
/**
     * 获取月卡详情
     * @data
     * @returns
     */
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}

/**
 * 更新月卡
 * @param {*} data
 * @returns
 */
export function updateCardAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}
/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export function delCardAPI(id) {
  return request({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}
/**
 * 批量删除月卡
 * @param {*} ids [1,2,3]
 * @returns
 */
export function delAllCardAPI(ids) {
  return request({
    url: `/parking/card/${ids.join(',')}`,
    method: 'DELETE'
  })
}
